home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / Electris / _install / su.sh < prev   
Linux/UNIX/POSIX Shell Script  |  1997-02-25  |  2KB  |  52 lines

  1. #!/bin/sh
  2. #-----------------------------------------------------------------------------
  3. #-----------------------------------------------------------------------------
  4.  
  5.  
  6. echo "
  7. Thank you for choosing to install LibC/Inside Trial Version.  
  8.  
  9. Please be sure to get the LICENSE information before attempting to install this software.  You will not be able to complete installation without it!
  10. "
  11. #
  12. # Check if root
  13. #
  14. if [ "$USER" = "root" ]; then
  15. while true
  16. do
  17.   echo "Would you like to install LibC/Inside, or Quit ? [y/q] \c"
  18.  
  19.   read ans
  20.   case "$ans" in
  21.         y|Y|yes|YES) exec $COMPANY_DIR/_install/install_unbundled;exit 0
  22.             ;;
  23.         N|Q|n|q|No|quit|NO|QUIT|Quit) echo;echo;echo "   cancelling installation"; sleep 5 ; exit 1
  24.             ;;
  25.         * ) echo ; echo ; echo "Please answer with y if you wish to install,"
  26.                    echo "   or q if you wish to quit (stop the install)"
  27.             ;;
  28.   esac
  29. done
  30.  
  31. else
  32. while true
  33. do
  34.   echo "You need to be super user to install this software. \c"
  35.   echo ""
  36.   echo "Would you like to install LibC/Inside, or Quit ? [y/q] \c"
  37.  
  38.   read ans
  39.   case "$ans" in
  40.         y|Y|yes|YES) echo "";echo "Enter super user \c";su root -c '$COMPANY_DIR/_install/install_unbundled';exit 0
  41.             ;;
  42.         N|Q|n|q|No|quit|NO|QUIT|Quit) echo;echo;echo "   cancelling installation of LibC/Inside"; sleep 5 ; exit 1
  43.             ;;
  44.         * ) echo ; echo ; echo "Please answer with y if you wish to install,"
  45.                    echo "   or q if you wish to quit (stop the install)"
  46.             ;;
  47.   esac
  48. done
  49.  
  50.  
  51. fi
  52.